Solving some calculus problems

Feras Awad Mahmoud
Philadelphia University, Department of Basic Sciences and
Mathematics, P. O. Box 1, Amman 19392, Jordan
feras_mahmoud@hotmail.com

Abstract. In this paper I introduce some commands and methods to solve some problems in calculus, like finding function domain and some analysis of functions algebraically, using version 6 of Mathematica.

There are many major, widely available, symbolic mathematical computer systems like Mathematica, Maple and Matlab. These systems have extensive similarities in the computational work they are intended to support [1]. Mathematica is a computer algebra software developed by Wolfram Research Inc., allowing you to use the computer as an interactive mathematics scratchpad. It can perform symbolic computation as well as numerical computation, produce graphic, provide support for programming, and so on. Mathematica is widely used by mathematicians, physicists, biologists, engineers, and can be a useful tool for many other sciences and applications [2,3,4,5].
  
If mathematics is the language of science, then calculus is a large part of the dictionary. Calculus is exactly what is needed to describe how things change, and this is an important way in which scientists use mathematics. Mathematica can be used for all the usual computations involving calculus : taking limits, finding derivatives, and computing integrals. One of the benefits of using Mathematica to solve calculus problems is the immediacy with which it produces answers. Solving calculus problems can require carrying out a long sequence of computations. Mathematica automates many of the problem solving steps for you, freeing you from worrying about the mechanics of solving the problem.
  
In this paper, I hit the highlights of some computations like computing the domain of a function and finding its intervals of increasing, decreasing, and concavity. The rest of the paper is organized as follows. In Section 2, I give the basic tools you will need to use Mathematica. The method of finding the domain of a function and its analysis is given in Section 3 and Section 4, respectively. Finally, I conclude this paper in Section 5.

Function domain

The domain of a real valued function f(x) is the set of all real numbers x such that f(x) is defined [6]. For example, the domain of (Sqrt[x-2]) is [2,∞). Note that, each function has a procedure to find the domain. Mathematica normally makes as few assumptions as possible about the objects you ask it to manipulate. This means that the results it gives are as general as possible. But sometimes these results are considerably more complicated than they would be if more assumptions were made. An important class of assumptions are those which assert that some object is an element of a particular domain. You can set up such assumptions using Element[x,dom], which assert that x is an element of the domain dom. There are many types of domains built into Mathematica: Integers, Rationals, Reals, Complexes, Algebraics, Primes, and Booleans, see [2,7].

Finding the domain of a function f will be supported by the two assumptions

assump1=Element[F[x],Reals];
assump2=Denominator[Together[F[x]]]≠0;

These assumptions realize the definition of the domain, and exclude the values of x that make the denominator of f equals to zero after combining its terms over a common denominator using Together command. To find the domain of the real valued function f we define a variable namely FuncDomain such that

FuncDomain=Reduce[assump1&&assump2,x,Reals];

The command Reduce[assump1 && assump2, Reals, x] will evaluate all real values of x that satisfy the conditions assump1 and assump2. The FuncDomain command cannot help when expressions have fractional powers with odd dominator because Mathematica treats x as a complex number in f(x), see [7]. For example, ((-1)^(1/3)) can represent any one of the values 1, -(1/2)+i((Sqrt[3])/2), or -(1/2)-i((Sqrt[3])/2).

Example  . The domain of f(x)=1/(1-|x|) is all the real values of x except x=1 and x=-1. To evaluate the domain of f(x) we first define the function as follows.

F[x_]:=Sqrt[x]/(1-Abs[x]);

Then we apply our FuncDomain command together with the assumptions, assump1 and assump2, as follows to get the answer.

assump1=Element[F[x],Reals];
assump2=Denominator[Together[F[x]]]≠0;
FuncDomain=Reduce[assump1&&assump2,x,Reals]

Computing the domain of a function of several variables can be done using the FuncDomain command with small changes on the assumptions.

Example  . To evaluate the domain of f(x,y)=(Sqrt[144-16(x^2)-9(y^2)]) using FuncDomain, we first define the function, and then change the commands as follows.

F[x_,y_]:=Sqrt[144-16x^2-9y^2];
assump1=Element[F[x,y],Reals];
assump2=Denominator[Together[F[x,y]]]≠0;
FuncDomain=Reduce[assump1&&assump2,{x,y},Reals]

The domain of f(x,y)=(Sqrt[144-16(x^2)-9(y^2)]) will be the set of ordered pairs (x,y) such that 16(x^2)+9(y^2)≤144. You can plot the domain of f(x,y) using the RegionPlot command as follows.

RegionPlot[FuncDomain,{x,-3,3},{y,-4,4},AspectRatio->Automatic,Frame->False,Axes->True]

Analysis of functions

Many of the applications of calculus depend on our ability to deduce facts about a function f from information concerning its derivatives. The first derivative f'(x) tells us the direction in which the curve proceeds at each point (increases or decreases), while the second derivative gives information about the way the graph of a differentiable function bends or turns (concavity). A differentiable function f is increasing on any interval where f' has positive value, and is decreasing on any interval where f' is negative, and is constant on any interval where f' is zero. If f is twice differentiable, then it is concave up on intervals where f'' is positive, and is concave down on intervals where f'' is negative. Computing the intervals of increasing, decreasing, and concavity needs the following assumptions to satisfy their definitions.

assump1=Element[F[x],Reals];
assump2=Element[D[F[x],x],Reals];
assump3=D[F[x],x]>0;
assump4=D[F[x],x]<0;
assump5=Element[D[F[x],{x,2}],Reals];
assump6=D[F[x],{x,2}]>0;
assump7=D[F[x],{x,2}]<0;

where D is built-in Mathematica operator for computing derivatives. The command D[F[x], x] computes the first derivative of the function, while D[F[x], {x, 2}] computes its second one. To compute the intervals of increasing and decreasing of a function f you use the commands

IncFunc=Reduce[assump1&&assump2&&assump3,x,Reals];
DecFunc=Reduce[assump1&&assump2&&assump4,x,Reals];

and to compute its intervals of concavity you use the commands

ConUp=Reduce[assump1&&assump5&&assump6,x,Reals];
ConDn=Reduce[assump1&&assump5&&assump7,x,Reals];

If the output of your command is True or False, which are the symbols for the Boolean values true and false respectively, then the interval will be the whole set of real numbers if the output is True, and the empty set if the output is False.

Example  . Suppose we would find the intervals of icreasing, decreasing, and concavity of f(x)=x-(Sqrt[x]). Define the function and apply the IncFunc, DecFunc, ConUp, and ConDn commands together with the assumptions, from assump1 to assump7, as follows.

F[x_]:=x-Sqrt[x];
assump1=Element[F[x],Reals];
assump2=Element[D[F[x],x],Reals];
assump3=D[F[x],x]>0;
assump4=D[F[x],x]<0;
assump5=Element[D[F[x],{x,2}],Reals];
assump6=D[F[x],{x,2}]>0;
assump7=D[F[x],{x,2}]<0;
IncFunc=Reduce[assump1&&assump2&&assump3,x,Reals];
DecFunc=Reduce[assump1&&assump2&&assump4,x,Reals];
ConUp=Reduce[assump1&&assump5&&assump6,x,Reals];
ConDn=Reduce[assump1&&assump5&&assump7,x,Reals];
answer = {IncFunc,DecFunc,ConUp,ConDn}

Recall that the relative extrema for a function f are those values of x in the domain of f which occur at a point where the graph of the function has horizontal tangent line or at a point where f is not differentiable. Such a point is called critical point [6]. The relative extrema of f occur at critical points but need not occur at every critical point. We define the following assumptions to evaluate the critical numbers of any function.

assump1=Element[F[x],Reals];
assump2=F'[x]==0;
assump3=Denominator[Together[F'[x]]]==0;

The command

CriticalNum=Reduce[assump1&&(assump2||assump3),x,Reals];

computes all the critical numbers of function. After computing the critical numbers, apply the first and second derivatives tests, see [6], to determine which of these numbers is an extrema and to classify its type (minimum or maximum).

Example  . To evaluate the critical numbers of f(x)=(Sqrt[ln(x)]) we do the following sequence of commands.

F[x_]:=Sqrt[Log[x]];
assump1=Element[F[x],Reals];
assump2=F'[x]==0;
assump3=Denominator[Together[F'[x]]]==0;
CriticalNum=Reduce[assump1&&(assump2||assump3),x,Reals]

Conclusion

In this paper, the analysis of functions using Mathematica has been discussed in depth. All the commands are executed using version 6 of Mathematica and many examples are given for the proposed commands. From the results I conclude that the commands are efficient and is suitable for functions of several variables with some modifications on the command's syntax. Also, the paper gives an addition proof that Mathematica is very helpful tool for mathematicians in computation and education.

References

K. Zotos, “Performance comparison of Maple and Mathematica,” Applied Mathematics and Computation, 188(2), 2007 pp. 1426-1429.

S. Wlofram. “Mathematica Solutions.” http://www.wolfram.com/solutions/.

U. Ufuktepe and G. Bacak, “Applying Mathematica and webMathematica to graph coloring,” Future Generation Computer Systems, 23(5), 2007 pp. 716-720.

A. Tocino, “Multiple stochastic integrals with Mathematica,” Mathematics and Computers in Simulation, 79(5), 2009 pp. 1658-1667.

A. Bret, “Beam-plasma dielectric tensor with Mathematica,” Computer Physics Communications, 176(5), 2007 pp. 362-366.

J. Stewart, Calculus Early Transcendentals, 6th ed., United States of America: Thomson Brooks/Cole, 2008

C-K Cheung, G.E. Keough, R. Gross, and C. Landraitis, Getting Started with Mathematica, 3ed., United States of America: John Wiley & Sons Inc., 2009.